<?php

namespace App\Services;

use App\Models\Users;
class UserService extends ServiceBase
{
    public function get($game_id, $channel, $openid, $getobj = true)
    {
        $user = Users::whereRaw("channel_openid='{$openid}' AND game_id={$game_id} AND channel={$channel}")->first();
        if (!$user) {
            return null;
        }

        return $getobj === true ? $user : $user->toArray();
    }
}
